(window.duAI = window.duAI || []).push([[29], {
    1399: function(e, t, a) {},
    1400: function(e, t, a) {},
    1401: function(e, t, a) {},
    1402: function(e, t, a) {},
    1403: function(e, t, a) {},
    1404: function(e, t, a) {},
    1405: function(e, t, a) {},
    1664: function(e, t, a) {
        "use strict";
        var s = a(1399);
        a.n(s).a
    },
    1665: function(e, t, a) {
        "use strict";
        
        var s = a(1400);
        a.n(s).a
    },
    1666: function(e, t, a) {
        "use strict";
        var s = a(1401);
        a.n(s).a
    },
    1667: function(e, t, a) {
        "use strict";
        var s = a(1402);
        a.n(s).a
    },
    1668: function(e, t, a) {
        "use strict";
        var s = a(1403);
        a.n(s).a
    },
    1669: function(e, t, a) {
        e.exports = a.p + "images/technology/face/detect/radio-uncheck.png"
    },
    1670: function(e, t, a) {
        e.exports = a.p + "images/technology/face/detect/radio-checked.png"
    },
    1671: function(e, t, a) {
        "use strict";
        var s = a(1404);
        a.n(s).a
    },
    1672: function(e, t, a) {
        e.exports = a.p + "images/technology/face/detect/demo-card-1.jpg"
    },
    1673: function(e, t, a) {
        e.exports = a.p + "images/technology/face/detect/demo-card-2.jpg"
    },
    1674: function(e, t, a) {
        e.exports = a.p + "images/technology/face/detect/demo-card-3.png"
    },
    1675: function(e, t, a) {
        e.exports = a.p + "images/technology/face/detect/demo-card-4.jpg"
    },
    1676: function(e, t, a) {
        e.exports = a.p + "images/technology/face/detect/demo-card-5.jpg"
    },
    1677: function(e, t, a) {
        "use strict";
        var s = a(1405);
        a.n(s).a
    },
    566: function(e, t, a) {
        "use strict";
        a.r(t);
        var s = function() {
            var e = this.$createElement
              , t = this._self._c || e;
            return t("div", {
                class: this.prefix + "-recognition"
            }, [t("div", {
                staticClass: "ai-container"
            }, [t("staticDemo")], 1)])
        };
        s._withStripped = !0;
        var i = function() {
            var e = this
              , t = e.$createElement
              , s = e._self._c || t;
            return s("div", {
                staticClass: "demo-detect-container"
            }, [s("div", {
                staticClass: "demo-container clear-content"
            }, [s("div", {
                staticClass: "clear-float"
            }, [s("div", {
                staticClass: "demo-data-container demo-data-left"
            }, [s("div", {
                staticClass: "demo-data-result",
                class: {
                    loading: e.isLoading
                },
                attrs: {
                    id: "demo-data-result"
                }
            }, [s("div", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: e.errorType,
                    expression: "errorType"
                }],
                staticClass: "demo-data-error-msg",
                attrs: {
                    id: "demo-data-error-msg"
                }
            }, [s("img", {
                staticClass: "error-img",
                attrs: {
                    src: a(559),
                    alt: ""
                }
            }), e._v(" "), s("div", {
                staticClass: "error-text",
                domProps: {
                    innerHTML: e._s(e.errorMsg[e.errorType])
                }
            })]), e._v(" "), e.isScanImg && !e.isLoading ? s("div", {
                staticClass: "demo-data-scan"
            }) : e._e(), e._v(" "), s("div", {
                ref: "canvasBottom",
                staticClass: "canvas-bottom"
            }), e._v(" "), s("div", {
                ref: "canvas",
                staticClass: "canvas-container"
            }), e._v(" "), s("div", {
                staticClass: "result-gallery"
            }, [s("image-gallery", {
                ref: "verticalGallery",
                attrs: {
                    imageList: e.imgResult,
                    config: e.verticalConfig,
                    disabled: e.isScanImg || e.isLoading
                },
                on: {
                    checkItem: e.dealMark
                }
            })], 1), e._v(" "), e.detectResult.length ? s("div", {
                staticClass: "face-result"
            }, [e._l(e.detectResult, function(t) {
                return e.params[t.key] && e.params[t.key].checked ? s("div", {
                    staticClass: "face-result-item"
                }, [s("span", {
                    staticClass: "face-result-item-label"
                }, [e._v(e._s(t.label) + ":")]), e._v(" "), s("span", {
                    staticClass: "face-result-item-value"
                }, [e._v(e._s(t.value))])]) : e._e()
            }), e._v(" "), s("div", {
                staticClass: "face-result-item"
            }, [s("span", {
                staticClass: "face-result-item-label"
            }, [e._v(e._s(e.detectResult[e.detectResult.length - 1].label))]), e._v(" "), s("span", {
                staticClass: "face-result-item-value"
            }, [s("cube", {
                attrs: {
                    cube: e.detectResult[e.detectResult.length - 1].value
                }
            })], 1)])], 2) : e._e(), e._v(" "), s("image-input", {
                ref: "imageInput",
                attrs: {
                    disabled: e.isScanImg || e.isLoading
                },
                on: {
                    checkItem: e.checkImg
                }
            })], 1), e._v(" "), s("div", {
                staticClass: "demo-img-gallery"
            }, [s("image-gallery", {
                ref: "horizonGallery",
                attrs: {
                    imageList: e.list,
                    config: e.horizonConfig,
                    disabled: e.isScanImg || e.isLoading
                },
                on: {
                    checkItem: e.checkImg
                }
            })], 1)]), e._v(" "), s("div", {
                staticClass: "demo-data-container demo-data-right"
            }, [s("json-show", {
                ref: "jsonShow",
                attrs: {
                    jsonData: e.showJson,
                    disabled: e.isScanImg || e.isLoading,
                    "is-cloud": e.isCloud,
                    conf: e.showJsonConf
                }
            }, [s("div", {
                attrs: {
                    slot: "check-form"
                },
                slot: "check-form"
            }, [s("div", {
                staticClass: "json-request-params-checkbox"
            }, [s("check-box", {
                attrs: {
                    checkboxes: e.params
                },
                on: {
                    changeChecked: e.changeCheck
                }
            })], 1), e._v(" "), s("div", {
                staticClass: "json-request-params-radio"
            }, [s("div", {
                staticClass: "params-landmark-text"
            }, [e._v("关键点")]), e._v(" "), s("radio-input", {
                attrs: {
                    list: e.landmarkList
                },
                on: {
                    "on-change": e.changeRadio
                },
                model: {
                    value: e.landmarkChoose,
                    callback: function(t) {
                        e.landmarkChoose = t
                    },
                    expression: "landmarkChoose"
                }
            })], 1), e._v(" "), s("div", {
                staticClass: "json-request-params-number"
            }, [s("div", {
                staticClass: "params-number-text"
            }, [e._v("最多处理人脸数")]), e._v(" "), s("div", {
                staticClass: "params-number-box"
            }, [s("span", {
                staticClass: "number-box number-box-minus",
                attrs: {
                    disabled: e.minusDisabled
                },
                on: {
                    click: e.changeNumberMinus
                }
            }, [e._v("-")]), e._v(" "), s("input", {
                directives: [{
                    name: "model",
                    rawName: "v-model.trim",
                    value: e.number,
                    expression: "number",
                    modifiers: {
                        trim: !0
                    }
                }],
                staticClass: "number-box number-box-num",
                attrs: {
                    type: "text",
                    disabled: e.isScanImg || e.isLoading
                },
                domProps: {
                    value: e.number
                },
                on: {
                    input: [function(t) {
                        t.target.composing || (e.number = t.target.value.trim())
                    }
                    , e.changeInput],
                    blur: function(t) {
                        return e.$forceUpdate()
                    }
                }
            }), e._v(" "), s("span", {
                staticClass: "number-box number-box-plus",
                attrs: {
                    disabled: e.plusDisabled
                },
                on: {
                    click: e.changeNumberPlus
                }
            }, [e._v("+")])])]), e._v(" "), s("div", {
                staticClass: "params-selected"
            }, [s("p", {
                staticClass: "params-selected-text"
            }, [e._v("max_face_num=" + e._s(e.number))]), e._v(" "), s("p", {
                staticClass: "params-selected-text"
            }, [e._v("face_fields=" + e._s(e.faceFields))]), e._v(" "), s("p", {
                staticClass: "params-selected-text"
            }, [e._v("image='图片的Base64编码'")])])])])], 1)])]), e._v(" "), e.isLoading || e.isDemo || e.isScanImg ? e._e() : s("div", {
                staticClass: "demo-detect-feedback"
            }, [s("span", {
                staticClass: "demo-detect-feedback-info",
                on: {
                    click: function(t) {
                        e.isShowFeedback = !e.isShowFeedback
                    }
                }
            }, [e._v("识别结果有误?")])]), e._v(" "), s("feedback-dialog", {
                attrs: {
                    show: e.isShowFeedback,
                    conf: e.feedConf
                },
                on: {
                    "update:show": function(t) {
                        e.isShowFeedback = t
                    },
                    submit: e.feedbackSubmit
                }
            })], 1)
        };
        i._withStripped = !0;
        a(126),
        a(55),
        a(59),
        a(31),
        a(506);
        var n = a(1663)
          , c = a.n(n)
          , r = a(15)
          , o = a.n(r)
          , l = function() {};
        function d(e, t) {
            var a, s, i, n = e.clientWidth, c = e.clientHeight, r = t.width, o = t.height, l = document.createElement("canvas");
            return l.setAttribute("width", r),
            l.setAttribute("height", o),
            s = o / c,
            i = (a = r / n) > 1 || s > 1 ? 1 / (a >= s ? a : s) : 1,
            l.style.cssText = "position: absolute; left: 50%; top: 50%;\n        -webkit-transform: translate(-50%, -50%) scale(".concat(i, ");\n        -moz-transform: translate(-50%, -50%) scale(").concat(i, ");\n        -ms-transform: translate(-50%, -50%) scale(").concat(i, ");\n        -o-transform: translate(-50%, -50%) scale(").concat(i, ");\n        transform: translate(-50%, -50%) scale(").concat(i, ");"),
            l.setAttribute("data-scale", i),
            l.getContext("2d").drawImage(t, 0, 0),
            l
        }
        function u(e, t) {
            var a = document.createElement("canvas");
            a.setAttribute("width", e.location.width),
            a.setAttribute("height", e.location.height);
            var s = a.getContext("2d");
            return s.rotate(-e.location.rotation * Math.PI / 180),
            s.translate(-e.location.left, -e.location.top),
            s.drawImage(t, 0, 0),
            a
        }
        a(127);
        var h = a(273)
          , m = a.n(h)
          , f = a(274)
          , g = a.n(f)
          , p = function() {
            function e(t) {
                t.selector;
                var a = t.image
                  , s = t.type
                  , i = t.apiType;
                t.toCheck,
                t.scale,
                t.success,
                t.fail,
                t.isAll;
                return m()(this, e),
                this.type = s,
                this.apiType = i,
                this.imageData = a,
                this.image = new Image,
                {
                    url: this.checkByUrl,
                    stream: this.checkByStream
                }[this.type](this.imageData, this.apiType)
            }
            return g()(e, [{
                key: "checkByUrl",
                value: function(e, t) {
                    return new Promise(function(a, s) {
                        var i, n, c, r, d, u, h, m, f;
                        n = (i = {
                            imageUrl: e,
                            type: t,
                            success: function(e) {
                                var t = e.data["Content-Type"]
                                  , i = e.data["Content-Length"];
                                102 !== e.errno ? /image\/(png|bmp|jpg|jpeg)/.test(t) && 106 !== e.errno ? i > 2097152 || 105 === e.errno ? s("tooLarge") : !e.errno && e.data ? a(e.data.image_data) : s("default") : s("format") : s("tooFrequent")
                            },
                            fail: function() {
                                s("default")
                            }
                        }).imageUrl,
                        c = void 0 === n ? null : n,
                        r = i.type,
                        d = i.success,
                        u = void 0 === d ? l : d,
                        h = i.fail,
                        m = void 0 === h ? l : h,
                        f = {
                            action: "getHeader",
                            type: r,
                            image_url: c
                        },
                        o.a.post("/aidemo").type("form").send(f).then(function(e) {
                            var t = e.body;
                            u(t)
                        }).catch(function(e) {
                            var t = e.body;
                            m(t)
                        })
                    }
                    )
                }
            }, {
                key: "checkByStream",
                value: function(e) {
                    return new Promise(function(t, a) {
                        var s = new FileReader;
                        e ? (s.readAsDataURL(e),
                        s.onload = function(s) {
                            /image\/(png|bmp|jpeg)/.test(e.type) ? e.size > 2097152 ? a("tooLarge") : t(s.target.result) : a("format")
                        }
                        ,
                        s.onerror = function() {
                            a("default")
                        }
                        ) : a("systemError")
                    }
                    )
                }
            }]),
            e
        }()
          , v = function() {
            var e = this
              , t = e.$createElement
              , a = e._self._c || t;
            return a("div", {
                staticClass: "image-input"
            }, [a("div", {
                staticClass: "image-input-container"
            }, [a("input", {
                directives: [{
                    name: "model",
                    rawName: "v-model.trim",
                    value: e.imgUrl,
                    expression: "imgUrl",
                    modifiers: {
                        trim: !0
                    }
                }],
                ref: "imageInput",
                staticClass: "image-url",
                attrs: {
                    type: "text",
                    spallcheck: "false",
                    placeholder: "请输入网络图片URL"
                },
                domProps: {
                    value: e.imgUrl
                },
                on: {
                    input: function(t) {
                        t.target.composing || (e.imgUrl = t.target.value.trim())
                    },
                    blur: function(t) {
                        return e.$forceUpdate()
                    }
                }
            }), e._v(" "), a("button", {
                staticClass: "image-button",
                class: {
                    "image-button-active": e.imgUrl
                },
                attrs: {
                    disabled: e.disabled
                },
                on: {
                    click: e.checkRemoteImg
                }
            }, [e._v("检测")]), e._v(" "), a("div", {
                staticClass: "image-text"
            }, [e._v("或")]), e._v(" "), a("label", {
                staticClass: "image-local"
            }, [a("input", {
                ref: "localInput",
                staticClass: "image-local-input",
                attrs: {
                    type: "file",
                    disabled: e.disabled,
                    accept: e.accept
                },
                on: {
                    change: e.checkLocalImg
                }
            }), e._v("\n            本地上传\n        ")])]), e._v(" "), a("div", {
                staticClass: "image-notice"
            }, [e._v("图片文件类型支持PNG、JPG、JPEG、BMP，图片大小不超过2M。")])])
        };
        v._withStripped = !0;
        var b = {
            name: "image-input",
            props: {
                disabled: {
                    type: Boolean,
                    default: !0
                },
                accept: {
                    type: String,
                    default: "image/png, image/bmp, image/jpg, image/jpeg"
                }
            },
            data: function() {
                return {
                    imgUrl: ""
                }
            },
            methods: {
                checkLocalImg: function(e) {
                    var t = (e.target || e.src).files[0];
                    t && (this.$emit("checkItem", t, "stream", !1, !0),
                    this.$refs.localInput.value = "")
                },
                checkRemoteImg: function() {
                    this.imgUrl && this.$emit("checkItem", this.imgUrl, "url", !1, !0, !0)
                },
                reset: function() {
                    this.imgUrl = "",
                    this.$refs.localInput.value = ""
                }
            }
        }
          , k = (a(1664),
        a(0))
          , _ = Object(k.a)(b, v, [], !1, null, null, null);
        _.options.__file = "src/demo/face/faceDetect/widget/image-input.vue";
        var y = _.exports
          , C = function() {
            var e = this
              , t = e.$createElement
              , a = e._self._c || t;
            return a("div", {
                ref: "gallery",
                staticClass: "gallery-container",
                class: [e.directClass]
            }, [a("div", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: e.prevShow,
                    expression: "prevShow"
                }],
                staticClass: "gallery-arrow-prev",
                on: {
                    click: e.changePrev
                }
            }, [a("div", {
                staticClass: "arrow-prev"
            })]), e._v(" "), "horizon" === e.config.type ? a("div", {
                staticClass: "gallery-item-container"
            }, [a("ul", {
                ref: "galleryWrapper",
                staticClass: "gallery-item",
                style: {
                    left: e.left + "px",
                    width: e.imageList.length * (e.config.baseWidth + 2 * e.config.margin) + "px"
                }
            }, e._l(e.imageList, function(t, s) {
                return a("li", {
                    key: s,
                    staticClass: "gallery-item-img-container",
                    class: {
                        "gallery-item-active": s === e.activeIndex
                    },
                    style: {
                        width: e.config.baseWidth + "px",
                        background: "url(" + t + ") center center / cover no-repeat"
                    },
                    on: {
                        click: function(a) {
                            return e.checkImg(t, s)
                        }
                    }
                })
            }), 0)]) : a("div", {
                staticClass: "gallery-item-container"
            }, [a("ul", {
                ref: "galleryWrapper",
                staticClass: "gallery-item",
                style: {
                    top: e.top + "px",
                    height: e.imageList.length * (e.config.baseHeight + 2 * e.config.margin) + "px"
                }
            }, e._l(e.imageList, function(t, s) {
                return a("li", {
                    key: s,
                    staticClass: "gallery-item-img-container",
                    class: {
                        "gallery-item-active": s === e.activeIndex
                    },
                    style: {
                        height: e.config.baseHeight + "px",
                        background: "url(" + t.imgSrc + ") center center / contain no-repeat"
                    },
                    on: {
                        click: function(a) {
                            return e.checkImg(t, s)
                        }
                    }
                })
            }), 0)]), e._v(" "), a("div", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: e.nextShow,
                    expression: "nextShow"
                }],
                staticClass: "gallery-arrow-next",
                on: {
                    click: e.changeNext
                }
            }, [a("div", {
                staticClass: "arrow-next"
            })])])
        };
        C._withStripped = !0;
        var w = {
            props: {
                imageList: {
                    type: Array,
                    default: function() {
                        return []
                    }
                },
                disabled: {
                    type: Boolean,
                    default: !0
                },
                config: {
                    type: Object,
                    default: function() {
                        return {}
                    }
                }
            },
            data: function() {
                return {
                    left: 0,
                    top: 0,
                    activeIndex: 0
                }
            },
            methods: {
                changeNext: function() {
                    var e = this.$refs.galleryWrapper.clientWidth
                      , t = this.$refs.galleryWrapper.clientHeight;
                    if ("horizon" === this.config.type && this.left > this.config.width + 2 * this.config.margin - e) {
                        var a = this.left + e > this.config.width + 2 * this.config.margin;
                        this.left -= a ? this.config.baseWidth + 2 * this.config.margin : e - this.left
                    } else if ("vertical" === this.config.type && this.top > this.config.height + this.config.margin - t) {
                        var s = this.top + t > this.config.height + this.config.margin;
                        this.top -= s ? this.config.baseHeight + this.config.margin : t - this.top
                    }
                },
                changePrev: function() {
                    var e = this.$refs.galleryWrapper.clientWidth
                      , t = this.$refs.galleryWrapper.clientHeight;
                    if ("horizon" === this.config.type && this.left < 0)
                        this.left + e < this.config.width + 2 * this.config.margin ? this.left = 0 : this.left += this.config.baseWidth + 2 * this.config.margin;
                    else if ("vertical" === this.config.type && this.top < 0) {
                        this.top + t < this.config.height + this.config.margin ? this.top = 0 : this.top += this.config.baseHeight + this.config.margin
                    }
                },
                checkImg: function(e, t) {
                    if (!this.disabled)
                        if (this.activeIndex = t,
                        "horizon" === this.config.type) {
                            var a = "".concat(window.location.protocol).concat(e);
                            this.$emit("checkItem", a, "url")
                        } else
                            this.$emit("checkItem", e)
                },
                reset: function() {
                    this.activeIndex = 0,
                    this.left = 0,
                    this.top = 0
                }
            },
            computed: {
                prevShow: function() {
                    return this.left < 0 || this.top < 0
                },
                nextShow: function() {
                    var e, t, a = this.config.baseWidth, s = this.config.baseHeight, i = this.config.margin, n = this.imageList.length, c = a + 2 * i, r = s + 2 * i;
                    return "horizon" === this.config.type ? e = (e = this.config.width < n * c) && n * c - this.config.width + this.left >= c : "vertical" === this.config.type && (t = (t = this.config.height < n * r) && n * r - this.config.height + this.top >= r),
                    !(!e && !t)
                },
                directClass: function() {
                    return "horizon" === this.config.type ? "gallery-horizon" : "gallery-vertical"
                }
            }
        }
          , x = (a(1665),
        Object(k.a)(w, C, [], !1, null, "79997e15", null));
        x.options.__file = "src/demo/face/faceDetect/widget/image-gallery.vue";
        var I = x.exports
          , S = function() {
            var e = this
              , t = e.$createElement
              , a = e._self._c || t;
            return a("div", {
                staticClass: "json"
            }, [a("div", {
                staticClass: "json-request"
            }, [a("div", {
                staticClass: "json-request-title",
                on: {
                    click: function(t) {
                        e.hideResponse = !e.hideResponse
                    }
                }
            }, [e._v("\n            Request\n            "), a("div", {
                staticClass: "json-request-title-show",
                class: {
                    "json-request-title-hide": e.hideResponse
                }
            })]), e._v(" "), a("div", {
                staticClass: "json-request-content",
                class: {
                    "json-request-content-hide": !e.hideResponse
                }
            }, [a("div", {
                staticClass: "json-request-params"
            }, [e._v("\n                Params\n                "), e._t("check-form")], 2), e._v(" "), a("div", {
                staticClass: "json-request-method"
            }, [e._v("\n                Post\n                "), a("div", {
                staticClass: "json-text json-request-method-content"
            }, [e._v(e._s(e.conf.post))])]), e._v(" "), a("div", {
                staticClass: "json-request-header"
            }, [e._v("\n                Header\n                "), a("div", {
                staticClass: "json-text json-request-header-content"
            }, [e._v(e._s(e.conf.header))])])])]), e._v(" "), a("div", {
                staticClass: "json-response"
            }, [a("div", {
                staticClass: "json-response-title",
                on: {
                    click: function(t) {
                        e.hideResponse = !e.hideResponse
                    }
                }
            }, [e._v("\n            Response\n            "), a("div", {
                staticClass: "json-response-title-show",
                class: {
                    "json-response-title-hide": e.hideResponse
                }
            })]), e._v(" "), a("div", {
                staticClass: "json-response-view",
                class: {
                    "json-response-view-hide": e.hideResponse
                }
            }, [a("a", {
                staticClass: "json-href",
                attrs: {
                    href: e.isCloud ? e.conf.cloudLink : e.conf.link,
                    target: "_blank"
                }
            }, [e._v("查看接口文档 >")]), e._v(" "), a("p", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: e.jsonData,
                    expression: "jsonData"
                }],
                staticClass: "json-content",
                domProps: {
                    innerHTML: e._s(e.highlightCode)
                }
            })])])])
        };
        S._withStripped = !0;
        var j = a(455)
          , L = a.n(j);
        a(561);
        L.a.registerLanguage("json", a(562));
        var R = {
            inject: {
                isCloud: {
                    default: !1
                }
            },
            props: {
                jsonData: {
                    type: Object,
                    default: function() {
                        return {}
                    }
                },
                disabled: {
                    type: Boolean,
                    default: !0
                },
                conf: {
                    type: Object,
                    default: function() {
                        return {
                            link: "",
                            post: "",
                            header: "",
                            cloudLink: ""
                        }
                    }
                }
            },
            data: function() {
                return {
                    hideResponse: !1
                }
            },
            computed: {
                highlightCode: function() {
                    return L.a.highlight("json", JSON.stringify(this.jsonData, "", "\t")).value
                }
            },
            methods: {
                reset: function() {
                    var e = this;
                    this.hideResponse = !1,
                    this.type = 0,
                    Object.keys(this.params).forEach(function(t) {
                        e.params[t].checked = !0
                    }),
                    this.number = 1
                }
            }
        }
          , $ = (a(1666),
        Object(k.a)(R, S, [], !1, null, null, null));
        $.options.__file = "src/demo/face/faceDetect/widget/json-show.vue";
        var D = $.exports
          , M = function() {
            var e = this
              , t = e.$createElement
              , a = e._self._c || t;
            return e.show ? a("div", {
                staticClass: "feedback"
            }, [a("div", {
                staticClass: "feedback-content",
                class: {
                    "feedback-content-active": e.isSubmitInfo
                }
            }, [e.isSubmitInfo ? [a("div", {
                staticClass: "feedback-content-title"
            }, [e._v("\n                识别反馈\n                "), a("div", {
                staticClass: "feedback-content-title-off",
                on: {
                    click: e.hide
                }
            })]), e._v(" "), a("div", {
                staticClass: "feedback-true-img"
            }), e._v(" "), a("div", {
                staticClass: "feedback-true-info"
            }, [e._v("提交成功")])] : [a("div", {
                staticClass: "feedback-content-title"
            }, [e._v("\n                识别结果错误反馈\n                "), a("div", {
                staticClass: "feedback-content-title-off",
                on: {
                    click: e.hide
                }
            })]), e._v(" "), a("div", {
                staticClass: "feedback-content-result"
            }, [e._v("反馈内容：")]), e._v(" "), a("div", {
                staticClass: "feedback-content-main"
            }, [a("textarea", {
                directives: [{
                    name: "model",
                    rawName: "v-model",
                    value: e.resultInput,
                    expression: "resultInput"
                }],
                staticClass: "feedback-content-input",
                attrs: {
                    spellcheck: "false",
                    placeholder: e.conf.placeholder,
                    maxlength: e.conf.maxLength
                },
                domProps: {
                    value: e.resultInput
                },
                on: {
                    input: function(t) {
                        t.target.composing || (e.resultInput = t.target.value)
                    }
                }
            })]), e._v(" "), a("div", {
                staticClass: "feedback-content-length"
            }, [e._v("\n                " + e._s(e.resultInput.length) + "/" + e._s(e.conf.maxLength) + "\n            ")]), e._v(" "), a("div", {
                staticClass: "feedback-content-submit"
            }, [a("button", {
                staticClass: "feedback-content-confirm",
                class: {
                    "feedback-content-confirm-blank": !e.resultInput.trim()
                },
                on: {
                    click: e.submit
                }
            }, [e._v("提交")]), e._v(" "), a("button", {
                staticClass: "feedback-content-off",
                on: {
                    click: e.hide
                }
            }, [e._v("取消")])])]], 2)]) : e._e()
        };
        M._withStripped = !0;
        var P = {
            props: {
                show: {
                    type: Boolean,
                    default: !1
                },
                conf: {
                    type: Object,
                    default: function() {
                        return {
                            placeholder: "",
                            maxLength: 20
                        }
                    }
                }
            },
            data: function() {
                return {
                    isSubmitInfo: !1,
                    resultInput: ""
                }
            },
            methods: {
                hide: function() {
                    this.$emit("update:show", !1),
                    this.isSubmitInfo = !1,
                    this.resultInput = ""
                },
                submit: function() {
                    this.resultInput.trim() && (this.isSubmitInfo = !0,
                    this.$emit("submit", this.resultInput),
                    this.resultInput = "")
                }
            }
        }
          , E = (a(1667),
        Object(k.a)(P, M, [], !1, null, null, null));
        E.options.__file = "src/demo/face/faceDetect/widget/feedback.vue";
        var q = E.exports
          , T = function() {
            var e = this
              , t = e.$createElement
              , a = e._self._c || t;
            return e.cube.pitch ? a("div", {
                staticClass: "cube",
                style: {
                    transform: "rotateX(" + e.cube.pitch + "deg) rotateY(" + e.cube.yaw + "deg) rotateZ(" + e.cube.roll + "deg)"
                }
            }, [a("div", {
                staticClass: "cube-side cube-front"
            }), e._v(" "), a("div", {
                staticClass: "cube-side cube-back"
            }), e._v(" "), a("div", {
                staticClass: "cube-side cube-left"
            }), e._v(" "), a("div", {
                staticClass: "cube-side cube-right"
            }), e._v(" "), a("div", {
                staticClass: "cube-side cube-top"
            }), e._v(" "), a("div", {
                staticClass: "cube-side cube-bottom"
            })]) : e._e()
        };
        T._withStripped = !0;
        var A = {
            props: ["cube"]
        }
          , O = (a(1668),
        Object(k.a)(A, T, [], !1, null, null, null));
        O.options.__file = "src/demo/face/faceDetect/widget/cube.vue";
        var N = O.exports
          , U = function() {
            var e = this
              , t = e.$createElement
              , a = e._self._c || t;
            return a("div", {
                staticClass: "checkbox-wrapper"
            }, e._l(e.checkboxes, function(t, s) {
                return a("label", {
                    staticClass: "checkbox-label",
                    attrs: {
                        for: s
                    },
                    on: {
                        click: function(a) {
                            return e.changeCheck(t, s)
                        }
                    }
                }, [a("img", {
                    staticClass: "checkbox-icon",
                    attrs: {
                        src: t.checked ? e.checkboxIcon.checked : e.checkboxIcon.uncheck,
                        alt: ""
                    }
                }), e._v(" "), a("span", {
                    staticClass: "checkbox-text"
                }, [e._v(e._s(t.name))])])
            }), 0)
        };
        U._withStripped = !0;
        var F = {
            props: {
                checkboxes: {
                    type: Object,
                    default: function() {
                        return {}
                    }
                },
                changeChecked: {
                    type: Function,
                    defaut: function() {}
                }
            },
            data: function() {
                return {
                    checkboxIcon: {
                        uncheck: a(1669),
                        checked: a(1670)
                    }
                }
            },
            methods: {
                changeCheck: function(e, t) {
                    this.$emit("changeChecked", e, t)
                }
            }
        }
          , W = (a(1671),
        Object(k.a)(F, U, [], !1, null, "4a22841e", null));
        W.options.__file = "src/demo/face/faceDetect/widget/checkbox.vue";
        var z = W.exports
          , B = {
            age: {
                name: "年龄",
                transform: function(e) {
                    return Math.round(e) + "岁"
                }
            },
            gender: {
                name: "性别",
                transform: function(e) {
                    return {
                        male: "男性",
                        female: "女性"
                    }[e.type]
                }
            },
            race: {
                name: "种族",
                transform: function(e) {
                    return {
                        yellow: "黄种人",
                        white: "白种人",
                        black: "黑种人",
                        arabs: "阿拉伯人"
                    }[e.type]
                }
            },
            beauty: {
                name: "颜值",
                transform: function(e) {
                    return Math.round(e)
                }
            },
            expression: {
                name: "表情",
                transform: function(e) {
                    return {
                        none: "不笑",
                        smile: "微笑",
                        laugh: "大笑"
                    }[e.type]
                }
            },
            glasses: {
                name: "眼镜",
                transform: function(e) {
                    return {
                        none: "无眼镜",
                        common: "普通眼镜",
                        sun: "墨镜"
                    }[e.type]
                }
            },
            emotion: {
                name: "情绪",
                transform: function(e) {
                    return {
                        angry: "愤怒",
                        disgust: "厌恶",
                        fear: "恐惧",
                        happy: "高兴",
                        sad: "伤心",
                        surprise: "惊讶",
                        neutral: "无情绪"
                    }[e.type]
                }
            },
            face_shape: {
                name: "脸型",
                transform: function(e) {
                    return {
                        square: "方形",
                        triangle: "三角形",
                        oval: "椭圆形",
                        heart: "心形",
                        round: "圆形"
                    }[e.type]
                }
            },
            mask: {
                name: "戴口罩",
                transform: function(e) {
                    return {
                        1: "有",
                        0: "无"
                    }[e.type]
                }
            }
        }
          , H = [a(1672), a(1673), a(1674), a(1675), a(1676)]
          , G = a(364)
          , J = [{
            value: "landmark150",
            name: "150关键点"
        }, {
            value: "landmark",
            name: "72关键点"
        }]
          , X = {
            inject: {
                isCloud: {
                    default: !1
                }
            },
            data: function() {
                return {
                    list: H,
                    isScanImg: !1,
                    isLoading: !1,
                    isDemo: !0,
                    data: {},
                    imgSrc: "",
                    imgResult: [],
                    isShowFeedback: !1,
                    errorMsg: {
                        format: "很抱歉，上传的图片不符合图片格式",
                        tooLarge: "很抱歉，上传的图片过大<br/>请重新上传一张图片",
                        systemError: "系统错误，请稍候再试",
                        noResult: "很抱歉，未检测到人脸<br/>请重新选择一张图片",
                        default: "很抱歉，获取图片失败",
                        tooFrequent: "很抱歉，您的请求过于频繁"
                    },
                    errorType: "",
                    params: {
                        age: {
                            checked: !0,
                            name: "年龄"
                        },
                        beauty: {
                            checked: !0,
                            name: "颜值"
                        },
                        expression: {
                            checked: !0,
                            name: "表情"
                        },
                        faceshape: {
                            checked: !0,
                            name: "脸型"
                        },
                        gender: {
                            checked: !0,
                            name: "性别"
                        },
                        glasses: {
                            checked: !0,
                            name: "眼镜"
                        },
                        race: {
                            checked: !0,
                            name: "种族"
                        },
                        quality: {
                            checked: !0,
                            name: "图像质量"
                        },
                        emotion: {
                            checked: !0,
                            name: "情绪"
                        },
                        mask: {
                            checked: !0,
                            name: "口罩"
                        }
                    },
                    number: 10,
                    detectResult: [],
                    itemData: {},
                    type: "",
                    url: "",
                    horizonConfig: {
                        width: 820,
                        type: "horizon",
                        baseWidth: 144,
                        baseHeight: 90,
                        margin: 10
                    },
                    verticalConfig: {
                        height: 375,
                        type: "vertical",
                        basewidth: 90,
                        baseHeight: 90,
                        margin: 2
                    },
                    showJsonConf: {
                        post: "https://aip.baidubce.com/rest/2.0/face/v3/detect?access_token=‘您的access_token’",
                        header: 'header: Content-Type: "application/x-www-form-urlencoded"',
                        link: "/ai-doc/FACE/yk37c1u4t",
                        cloudLink: "/doc/FACE/s/yk37c1u4t"
                    },
                    feedConf: {
                        placeholder: "请填写反馈内容，如“性别识别有误，应为女性”",
                        maxLength: 50
                    },
                    landmarkList: J,
                    landmarkChoose: J[0].value,
                    logId: ""
                }
            },
            components: {
                imageInput: y,
                imageGallery: I,
                jsonShow: D,
                feedbackDialog: q,
                cube: N,
                checkBox: z,
                radioInput: G.a
            },
            mounted: function() {
                var e = "".concat(window.location.protocol).concat(H[0]);
                this.checkImg(e, "url")
            },
            methods: {
                drawRect: function(e) {
                    for (var t = this.$refs.canvas, a = t.children[0].getContext("2d"), s = t.children[0].getAttribute("data-scale"), i = 0, n = e.length; i < n; i++) {
                        var c = e[i]
                          , r = c.location;
                        a.save(),
                        a.lineWidth = Math.round(2 / s),
                        a.strokeStyle = "rgba(0, 115, 235, .8)",
                        a.translate(r.left, r.top),
                        a.rotate(c.location.rotation / 180 * Math.PI),
                        a.rect(0, 0, r.width, r.height),
                        a.stroke(),
                        a.restore()
                    }
                },
                drawLandMark: function(e, t) {
                    var a = this.$refs.canvas
                      , s = a.children[0].getContext("2d")
                      , i = a.children[0].getAttribute("data-scale")
                      , n = t ? {
                        x: e.location.left,
                        y: e.location.top
                    } : {
                        x: 0,
                        y: 0
                    }
                      , c = t ? e.location.rotation : 0
                      , r = function(e) {
                        s.beginPath(),
                        s.lineWidth = 1,
                        s.fillStyle = "rgba(0, 115, 235, 0.8)",
                        s.strokeStyle = "transparent";
                        var t, a, r = (t = e.x - n.x,
                        a = e.y - n.y,
                        (360 * Math.atan(a / t) / (2 * Math.PI) - c) / 180 * Math.PI), o = function(e, t) {
                            return Math.sqrt(Math.pow(e, 2) + Math.pow(t, 2))
                        }(e.x - n.x, e.y - n.y);
                        s.arc(o * Math.cos(r), o * Math.sin(r), 2 / i, 0, 2 * Math.PI),
                        s.fill(),
                        s.stroke(),
                        s.closePath()
                    };
                    
                    if (this.landmarkChoose === this.landmarkList[0].value)
                        for (var o in e.landmark150) {
                            r(e.landmark150[o])
                        }
                    else
                        for (var l = 0, d = e.landmark72.length; l < d; l++) {
                            r(e.landmark72[l])
                        }
                },
                startScan: function(e, t, a) {
                    var s, i, n, c, r, d, u, h, m, f, g, p, v, b = this, k = {
                        maxFaceNum: b.number,
                        faceFields: "age,beauty,expression,faceshape,gender,glasses,landmark,landmark150,race,quality,emotion,mask",
                        success: function(e) {
                            b.isScanImg = !1,
                            b.data = e.data.result,
                            b.logId = e.data.log_id;
                            var t = e.errno
                              , a = e.data;
                            0 === t ? a.result && a.result.face_num ? (b.drawRect(a.result.face_list),
                            b.getGallerySrc(b.imgSrc, a)) : b.errorType = "noResult" : b.errorType = 222304 === t ? "tooLarge" : 222051 === t ? "format" : 222202 === t ? "noResult" : 102 === t ? "tooFrequent" : "systemError"
                        },
                        fail: function(e) {
                            b.errorType = "default",
                            b.isScanImg = !1,
                            b.reset()
                        }
                    };
                    "url" === e ? k.imageUrl = a : k.image = t,
                    b.isScanImg = !0,
                    i = (s = k).image,
                    n = void 0 === i ? null : i,
                    c = s.imageUrl,
                    r = void 0 === c ? null : c,
                    d = s.success,
                    u = void 0 === d ? l : d,
                    h = s.fail,
                    m = void 0 === h ? l : h,
                    f = s.maxFaceNum,
                    g = void 0 === f ? 1 : f,
                    p = s.faceFields,
                    v = {
                        type: "face",
                        image: n,
                        image_type: "BASE64",
                        image_url: r,
                        max_face_num: g,
                        face_field: void 0 === p ? "" : p
                    },
                    o.a.post("/aidemo").type("form").send(v).then(function(e) {
                        var t = e.body;
                        u(t)
                    }).catch(function(e) {
                        var t = e.body;
                        m(t)
                    })
                },
                getGallerySrc: function(e, t) {
                    var a = this;
                    a.imgResult = [],
                    a.imgResult.push({
                        imgSrc: a.imgSrc,
                        record: t,
                        isAll: !0
                    });
                    var s = new Image;
                    s.onload = function() {
                        for (var e = 0, i = t.result.face_list.length; e < i; e++) {
                            var n = t.result.face_list[e]
                              , c = u(n, s);
                            a.imgResult.push({
                                imgSrc: c.toDataURL(),
                                record: n,
                                isAll: !1
                            })
                        }
                    }
                    ,
                    s.src = e
                },
                checkImg: function(e, t, a, s, i) {
                    var n = this;
                    n.errorType = "";
                    var c, r = n.$refs.canvas;
                    r.children.length && r.removeChild(r.children[0]),
                    n.$refs.verticalGallery.reset(),
                    n.itemData = {},
                    a || (n.resetParams(),
                    n.reset()),
                    s && (this.$refs.horizonGallery.activeIndex = ""),
                    n.isLoading = !0,
                    n.detectResult = [],
                    n.type = t,
                    n.url = e,
                    "stream" === t ? n.isDemo = !1 : e.indexOf("ai_images/technology/face-detect") > 0 ? n.isDemo = !0 : n.isDemo = !1,
                    i && (c = "face");
                    var o = new p({
                        image: e,
                        type: t,
                        apiType: c
                    })
                      , l = new Image;
                    o.then(function(a) {
                        n.isLoading = !1,
                        n.imgSrc = a,
                        l.onload = function() {
                            var e = n.$refs.canvas
                              , t = d(n.$refs.canvas, l);
                            e.children.length && e.removeChild(e.children[0]),
                            e.appendChild(t)
                        }
                        ,
                        l.src = a,
                        n.startScan(t, a, e)
                    }, function(e) {
                        n.errorType = e,
                        n.reset()
                    }),
                    l.onerror = function() {
                        n.errorType = "default",
                        n.reset()
                    }
                },
                dealMark: function(e) {
                    var t = this;
                    t.itemData = e;
                    var a = e.isAll;
                    t.$refs.canvasBottom.style.cssText = a ? "background: transparent" : "background: url(".concat(t.imgResult[0].imgSrc, ") no-repeat;") + "background-position: center center;opacity: .35; -webkit-filter: blur(20px); -moz-filter: blur(20px); filter: blur(20px)";
                    var s = new Image;
                    s.onload = function() {
                        var i, n = t.$refs.canvas;
                        i = a ? d(t.$refs.canvas, s) : t.drawSmallImage(t.$refs.canvas, s),
                        n.children.length && n.removeChild(n.children[0]),
                        n.appendChild(i),
                        t.detectResult = [],
                        a ? t.drawRect(e.record.result.face_list) : (t.drawLandMark(e.record, !0),
                        Object.keys(B).forEach(function(a) {
                            var s = B[a].name
                              , i = B[a].transform(e.record[a]);
                            t.detectResult.push({
                                label: s,
                                value: i,
                                key: a
                            })
                        }),
                        t.detectResult.push({
                            label: "头部姿态",
                            value: {
                                pitch: -e.record.angle.pitch,
                                yaw: -e.record.angle.yaw,
                                roll: e.record.angle.roll
                            },
                            key: "pose"
                        }))
                    }
                    ,
                    s.src = e.imgSrc
                },
                reset: function() {
                    this.isScanImg = !1,
                    this.isLoading = !1,
                    this.isDemo = !0,
                    this.data = {},
                    this.imgSrc = "",
                    this.imgResult = [],
                    this.number = 10,
                    this.isShowFeedback = !1,
                    this.$refs.canvasBottom.style.cssText = "background: transparent",
                    this.$refs.imageInput.reset()
                },
                resetParams: function() {
                    var e = this;
                    Object.keys(this.params).forEach(function(t) {
                        e.params[t].checked = !0
                    })
                },
                feedbackSubmit: function(e) {
                    !function(e) {
                        var t = e.text
                          , a = void 0 === t ? "" : t
                          , s = e.success
                          , i = void 0 === s ? l : s
                          , n = e.fail
                          , c = void 0 === n ? l : n
                          , r = e.logId
                          , d = {
                            action: "feedback",
                            type: "face",
                            log_id: void 0 === r ? "" : r,
                            correct: 1,
                            suggestions: JSON.stringify({
                                content: a
                            })
                        };
                        o.a.post("/aidemo").type("form").send(d).then(i).catch(function(e) {
                            var t = e.body;
                            c(t)
                        })
                    }({
                        logId: this.logId,
                        text: e,
                        success: function() {},
                        fail: function() {}
                    })
                },
                changeInput: function(e) {
                    isNaN(this.number) ? this.number = 10 : this.number > 0 && this.number < 11 ? this.number = parseInt(this.number, 10) : this.number = 10,
                    this.isScanImg || this.isLoading || ("stream" === this.type ? this.checkImg(this.url, "stream", !0) : this.checkImg(this.url, "url", !0))
                },
                changeNumberMinus: function() {
                    this.isScanImg || this.isLoading || this.number <= 1 || (this.number -= 1,
                    "stream" === this.type ? this.checkImg(this.url, "stream", !0) : this.checkImg(this.url, "url", !0))
                },
                changeNumberPlus: function() {
                    this.isScanImg || this.isLoading || this.number >= 10 || (this.number += 1,
                    "stream" === this.type ? this.checkImg(this.url, "stream", !0) : this.checkImg(this.url, "url", !0))
                },
                changeCheck: function(e, t) {
                    this.params[t].checked = !this.params[t].checked
                },
                changeRadio: function() {
                    this.itemData.record && this.dealMark(this.itemData)
                },
                drawSmallImage: function(e, t) {
                    e.clientWidth,
                    e.clientHeight;
                    var a, s, i, n = t.width, c = t.height, r = document.createElement("canvas");
                    return r.setAttribute("width", n),
                    r.setAttribute("height", c),
                    s = c / 150,
                    i = (a = n / 150) > 1 || s > 1 ? 1 / (a >= s ? a : s) : a > s ? 1 / a : 1 / s,
                    r.style.cssText = "position: absolute; left: 307px; top: 91px;\n                -webkit-transform: scale(".concat(i, ");\n                -moz-transform: scale(").concat(i, ");\n                -ms-transform: scale(").concat(i, ");\n                -o-transform: scale(").concat(i, ");\n                transform: scale(").concat(i, ");\n                -webkit-transform-origin: left top;\n                -moz-transform-origin: left top;\n                -ms-transform-origin: left top;\n                -o-transform-origin: left top;\n                translate-origin: left top"),
                    r.getContext("2d").drawImage(t, 0, 0),
                    r.setAttribute("data-scale", i),
                    r
                }
            },
            computed: {
                faceFields: function() {
                    var e = this
                      , t = [];
                    return Object.keys(this.params).forEach(function(a) {
                        e.params[a].checked && t.push(a)
                    }),
                    t.push("landmark150" === this.landmarkChoose ? "landmark150" : "landmark72"),
                    t.join(",")
                },
                showJson: function() {
                    var e = this
                      , t = {};
                    if (!this.data)
                        return t;
                    var a = this.data.face_num;
                    return t = c()(this.data),
                    Object.keys(this.params).forEach(function(s) {
                        for (var i = 0; i < a; i++)
                            if (e.params[s].checked || (delete t.face_list[i][s],
                            "face" === s || "glasses" === s || "race" === s || "gender" === s ? delete t.face_list[i]["".concat(s, "_probability")] : "expression" === s && delete t.face_list[i]["".concat(s, "_probablity")]),
                            t.face_list && t.face_list[i])
                                switch (e.landmarkChoose) {
                                case "landmark150":
                                    delete t.face_list[i].landmark72,
                                    delete t.face_list[i].landmark;
                                    break;
                                case "landmark":
                                    delete t.face_list[i].landmark150,
                                    delete t.face_list[i].landmark
                                }
                    }),
                    t
                },
                plusDisabled: function() {
                    return this.isScanImg || this.isLoading || 10 === this.number
                },
                minusDisabled: function() {
                    return this.isScanImg || this.isLoading || 1 === this.number
                }
            }
        }
          , Y = (a(1677),
        Object(k.a)(X, i, [], !1, null, null, null));
        Y.options.__file = "src/demo/face/faceDetect/app.vue";
        var Z = {
            components: {
                staticDemo: Y.exports
            },
            mounted: function() {},
            data: function() {
                return {
                    prefix: "tech"
                }
            }
        }
          , K = Object(k.a)(Z, s, [], !1, null, null, null);
        K.options.__file = "src/demo/entry/face/faceDetect.vue";
        t.default = K.exports
    }
}]);


